﻿using System;
using System.Windows.Forms;


namespace MyServiceClient
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void btWhAdd_Click(object sender, EventArgs e)
        {
            txtWhRes.Text = "";
            var server = new WebHostCalculator.CalculatorClient();
            int n1 = int.Parse(txtWhN1.Text);
            int n2 = int.Parse(txtWhN2.Text);
            int res = server.Add(n1, n2);
            txtWhRes.Text = res.ToString();
        }

        private void btShAdd_Click(object sender, EventArgs e)
        {
            txtShRes.Text = "";
            var server = new SelfHostCalculator.CalculatorClient();
            int n1 = int.Parse(txtShN1.Text);
            int n2 = int.Parse(txtShN2.Text);
            int res = server.Add(n1, n2);
            txtShRes.Text = res.ToString();
        }
    }
}